<layout name='Layout/ace_layout' />
{:W('PageHeader',array('name'=>array($flow_type['name'],'：',$vo['name']),'search'=>'N'))}
<div class="operate panel panel-default hidden-print">
	<div class="panel-body">
		<div class="pull-left">
			<a onclick="go_return_url();" class="btn btn-sm btn-primary">返回</a>
			<a href="#flow_status"  class="btn btn-sm btn-primary">审批情况</a>
			<notempty name="to_confirm">
				<a href="#confirm"  class="btn btn-sm btn-primary">办理意见</a>
			</notempty>
		</div>
		<div class="pull-right">
			<a onclick="winprint();" class="btn btn-sm btn-primary">打印</a>
			<eq name="is_edit" value="1">
				<a onclick="save();" class="btn btn-sm btn-primary">保存</a>
			</eq>
		</div>
	</div>
</div>
<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"  class="well form-horizontal">
	<input type="hidden" id="ajax" name="ajax" value="0">
	<input type="hidden" id="opmode" name="opmode" value="edit">
	<input type="hidden" id="name" name="name" value="{$vo.name}">
	<input type="hidden" id="id" name="id" value="{$vo.id}">
	<div class="form-group col-sm-6">
		<label class="col-sm-4 control-label" >文件编号：</label>
		<div class="col-sm-8">
			<p class="form-control-static">
				{$vo.doc_no}
			</p>
		</div>
	</div>

	<div class="form-group col-sm-6">
		<label class="col-sm-4 control-label" >日期：</label>
		<div class="col-sm-8">
			<p class="form-control-static">
				{$vo.create_time|toDate='Y-m-d'}
			</p>
		</div>
	</div>

	<div class="form-group  col-sm-6">
		<label class="col-sm-4 control-label" >编写人：</label>
		<div class="col-sm-8">
			<p class="form-control-static">
				{$vo.user_name}
			</p>
		</div>
	</div>

	<div class="form-group  col-sm-6">
		<label class="col-sm-4 control-label" >部门：</label>
		<div class="col-sm-8">
			<p class="form-control-static">
				{$vo.dept_name}
			</p>
		</div>
	</div>

	<div class="form-group  col-xs-12">
		<label class="col-sm-2 control-label" >审批：</label>
		<div class="col-sm-10">
			<p id="confirm_wrap" class="form-control-static">
				{$vo.confirm_name}
			</p>
		</div>
	</div>

	<div class="form-group col-xs-12">
		<label class="col-sm-2 control-label" >协商：</label>
		<div class="col-sm-10">
			<p id="consult_wrap" class="form-control-static address_list">
				{$vo.consult_name}
			</p>
		</div>
	</div>
	<div class="form-group col-xs-12">
		<label class="col-sm-2 control-label" >抄送：</label>
		<div class="col-sm-10">
			<p id="refer_wrap" class="form-control-static address_list">
				{$vo.refer_name}
			</p>
		</div>
	</div>
	<volist name="field_list" id="field_vo">
		{:W('FlowField',$field_vo)}
	</volist>
	
	<neq name="is_edit" value="2">
		<div class="form-group">
			<div class="col-xs-12">
				<eq name = "is_edit" value="0">
					<div class="content_wrap">
						<iframe class="content_iframe"></iframe>
						<textarea class="content display-none"  name="content" style="width:100%;height:300px;" >{$vo.content}</textarea>
					</div>
				</eq>				
				<eq name="is_edit" value="1">
					<textarea class="editor content display-none"  name="content" style="width:100%;height:300px;" >{$vo.content}</textarea>
					<eq>
			</div>
		</div>
	</neq>
	<notempty name="vo.add_file">
		<div class="form-group">
			<label class="col-sm-2 control-label" >附件：</label>
			<div class="col-sm-10">
				<eq name="is_edit" value="1">
					{:W('File',array('add_file'=>$vo['add_file'],'mode'=>'show'))}
				</eq>
				<eq name="is_edit" value="1">
					{:W('File',array('add_file'=>$vo['add_file'],'mode'=>'edit'))}
				</eq>
			</div>
		</div>
	</notempty>
	<div class="clearfix"></div>
</form>

<a id="flow_status"></a>
{:W('PageHeader',array('name'=>'审批情况','search'=>'N'))}
<div class="ul_table border-bottom">
	<ul>
		<li class="thead">
			<span class="col-9 text-center">类型</span>
			<span class="col-9 text-center">审批人</span>
			<span class="col-9 text-center">日期</span>
			<span class="col-9 text-center">结果</span>
			<span class="auto">意见</span>
		</li>
		<volist name="flow_log" id="item">
			<li class="tbody">
				<span style="width:90px;" class="text-center">{$item.step|show_step_type}</span>
				<span style="width:90px;" class="text-center">{$item.user_name}</span>
				<span style="width:90px;" class="text-center">{$item.create_time|toDate='Y-m-d'}</span>
				<span style="width:90px;" class="text-center">{$item.result|show_result}</span>
				<span class="auto">
					<div style="overflow:hidden">
						{$item.comment}
					</div> </span>
			</li>
		</volist>
	</ul>
</div>
<notempty name="to_confirm">
	<a id="confirm"></a>
	{:W('PageHeader',array('name'=>'办理意见','search'=>'N'))}
	<form method="post" action="" name="form_confirm" id="form_confirm">
		<input type="hidden" name="id" value="{$to_confirm.id}">
		<input type="hidden" name="flow_id" value="{$vo.id}">
		<input type="hidden" name="step" value="{$to_confirm.step}">
		<div class="operate panel panel-default">
			<div class="panel-heading clearfix">
				<div class="pull-left">
					<a onclick="go_return_url();" class="btn btn-sm btn-primary">返回</a>
				</div>
				<div class="pull-right">
					<notempty name="is_edit">
						<div class="btn-group">
							<a class="btn btn-sm btn-warning dropdown-toggle" data-toggle="dropdown" href="#">退回到<span class="fa fa-caret-down"></span> </a>
							<ul class="dropdown-menu col-5">
								<volist name="confirmed" id="vo">
									<li onclick="back_to('{$vo.emp_no}');">
										<a>{$vo.user_name}</a>
									</li>
								</volist>
								<li onclick="back_to('{$emp_no}');">
									<a>{$user_name}</a>
								</li>
							</ul>
						</div>
					</notempty>
					<a onclick="reject();" class="btn btn-sm btn-danger">否决</a>
					|
					<a onclick="approve();" class="btn btn-sm btn-primary">同意</a>
				</div>
			</div>
			<div class="form-group panel-body">
				<label class="col-sm-2 control-label" >办理意见：</label>
				<div class="col-sm-10">
					<textarea name="comment" class="col-xs-12" style="height:120px"></textarea>
				</div>
			</div>
		</div>
	</form>
</notempty>